package com.companyname.projecttemplate.mapping;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.companyname.projecttemplate.ao.ws.WsSessionAO;
import com.gitee.magic.framework.head.vo.BaseVO;
import com.gitee.magic.framework.head.vo.ObjectVO;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * @author start
 */
@Tag(name = "WsMapping")
public interface WsMapping {
	
	/**
	 * 是否在线
	 * @param userId
	 * @return
	 */
    @Operation(summary="是否在线")
	@GetMapping("/v1/ws/online/{userId}")
	ObjectVO<Boolean> online(@PathVariable @Parameter(description = "用户Id") String userId);
    
	/**
	 * 获取通道
	 * @param userId
	 * @return
	 */
    @Operation(summary="获取通道")
	@GetMapping("/v1/ws/channel/{userId}")
	ObjectVO<String> channel(@PathVariable @Parameter(description = "用户Id") String userId);
	
    /**
     * 发送消息
     * @param ao
     * @return
     */
    @Operation(summary="发送消息")
	@PostMapping("/v1/ws/send")
	BaseVO send(@RequestBody WsSessionAO ao);
	
}
